home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / domácnost a kancelar / winorganizer / WinOrg.exe / PluginsAndCOM / Plugins / Demo / DemoPlug.dpr < prev    next >
Encoding:
Text File  |  2005-07-06  |  1.3 KB  |  68 lines

  1. library DemoPlug;
  2.  
  3. uses
  4.   SysUtils,
  5.   Classes,
  6.   windows,
  7.   fDocProp in 'fDocProp.pas' {frmDocProperties},
  8.   fTree in 'fTree.pas' {frmTree},
  9.   fList in 'fList.pas' {frmList},
  10.   fComment in 'fComment.pas' {frmComment};
  11.  
  12. {$R *.RES}
  13. {$R DemoPlug1.RES}
  14.  
  15. procedure ShowMessage(const S: String);
  16. begin
  17.   MessageBox(0, PChar(S), 'Message', MB_OK);
  18. end;
  19.  
  20. function GetCount: Integer; stdcall;
  21. begin
  22.   Result := 4;
  23. end;
  24.  
  25. function GetCaption(Index: Integer; const Language: WideString): WideString; stdcall;
  26. begin
  27.   case Index of
  28.     0: Result := 'Current document properties (Demo plugin)';
  29.     1: Result := 'Tree of documents';
  30.     2: Result := 'List of records';
  31.     3: Result := 'View comment as RTF';
  32.   end;
  33. end;
  34.  
  35. function GetIconName(Index: Integer): WideString; stdcall;
  36. begin
  37.   if Index = 0 then
  38.     Result := 'DemoProp'
  39.   else
  40.     Result := '';
  41. end;
  42.  
  43. procedure Execute(Index: Integer); stdcall;
  44. begin
  45.   try
  46.     case Index of
  47.       0: TFrmDocProperties.Execute;
  48.       1: TfrmTree.Execute;
  49.       2: TfrmList.Execute;
  50.       3: TFrmComment.Execute;
  51.     else
  52.       ShowMessage('Exec item ' + IntToStr(Index));
  53.     end;
  54.   except
  55.     on E:Exception do
  56.       ShowMessage(E.Message);
  57.   end;
  58. end;
  59.  
  60. exports
  61.   GetCount,
  62.   GetCaption,
  63.   GetIconName,
  64.   Execute;
  65.  
  66. begin
  67. end.
  68.